package com.accp.restaurant.controller;

import com.accp.restaurant.entity.Room;
import com.accp.restaurant.service.ReserveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("/Reserve")
public class ReserveController {

    @Autowired
    private ReserveService reserveService;


    @RequestMapping("/Reserve")
    @ResponseBody
    public List<Room> Reserve(Integer toroomid){
        if(toroomid==1){
            return reserveService.query(toroomid);
        }else if(toroomid==2){
            return reserveService.query(toroomid);
        }
        return null;
    }
}